import React from 'react';
import {useAppContext} from "../context";
function B(props) {
    // console.log(useAppContext())
    const {userName,age,setUserName} = useAppContext();
    return (
        <div>
            <h3>B</h3>
            <button onClick={setUserName.bind(null,"qianshi")}>更改userName</button>
            <p>userName:{userName}</p>
            <p>age:{age}</p>
        </div>
    );
}

export default B;